home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume16 / ecu3 / part33 < prev    next >
Encoding:
Internet Message Format  |  1991-01-06  |  46.8 KB

  1. From: wht@n4hgf.uucp (Warren Tucker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v16i057:  ECU async comm package rev 3.0, Part33/35
  4. Message-ID: <1991Jan6.054118.29086@sparky.IMD.Sterling.COM>
  5. Date: 6 Jan 91 05:41:18 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 250a2f93 2220d6b3 24c5f987 67954661
  8.  
  9. Submitted-by: wht@n4hgf.uucp (Warren Tucker)
  10. Posting-number: Volume 16, Issue 57
  11. Archive-name: ecu3/part33
  12.  
  13. ---- Cut Here and feed the following to sh ----
  14. #!/bin/sh
  15. # This is part 33 of ecu3
  16. if touch 2>&1 | fgrep 'amc' > /dev/null
  17.  then TOUCH=touch
  18.  else TOUCH=true
  19. fi
  20. # ============= doc/_p_cmd.txt ==============
  21. if test ! -d 'doc'; then
  22.     echo 'x - creating directory doc'
  23.     mkdir 'doc'
  24. fi
  25. echo 'x - extracting doc/_p_cmd.txt (Text)'
  26. sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_cmd.txt' &&
  27. X.*s 2 "Commands"
  28. X
  29. X.*s 3 "baud"
  30. X
  31. Xusage: baud <baud-int>
  32. X
  33. XThis command sets the baud rate for the attached line.
  34. XThe integer argument <baud-int> must be one of
  35. X110, 300, 600, 1200, 2400, 4800, 9600, 19200 and 38400.
  36. X.DS L
  37. XExample:
  38. X    baud 9600
  39. X    set $i0=2400; baud $i0
  40. X.DE
  41. X
  42. X.*s 3 "break"
  43. X
  44. Xusage: break
  45. X
  46. XThis command is used inside a
  47. X.B whilei
  48. Xor
  49. X.B whiles
  50. Xcompound statement to exit the loop.
  51. X.DS L
  52. XExample:
  53. X
  54. X    whilei 1=1 #forever unless break command executed
  55. X    {
  56. X        echo -n 'Answer yes or no: '
  57. X        set $s0=%cgets # get answer
  58. X        ifi %instr($s0,'y') == 0 set $i0 = 1; break
  59. X        ifi %instr($s0,'n') == 0 set $i0 = 0; break
  60. X        # got neither 'y' nor 'n' ... keep trying
  61. X    }
  62. X    # now $i0 = 1 if yes, 0 if no
  63. X.DE
  64. X
  65. XNOTE: further examples of
  66. X.B break
  67. Xusage may be found in the example for the
  68. Xelse
  69. Xcommand.
  70. X
  71. X.*s 3 "cd"
  72. X
  73. Xusage: cd <directory-path>
  74. X
  75. XThis command changes ECU's current working directory.
  76. XThe string argument <directory-path> may contain any
  77. Xdirectory pathname specification legal to be submitted to
  78. Xthe shell csh.  Wild card characters may be used, provided
  79. Xthe expansion produces only one pathname.
  80. X
  81. X.DS L
  82. XExample:
  83. X
  84. X    cd '~user/bin'
  85. X    cd %envvar('HOME')+'/bin'
  86. X.DE
  87. X
  88. X.*s 3 "clrx"
  89. X
  90. Xusage: clrx
  91. X
  92. XThis command clears  the attached line's transmitter XOFF state.
  93. XIssuing the command is the equivalent to receiving an XON from
  94. Xthe remote system.
  95. X
  96. X.*s 3 "cls"
  97. X
  98. Xusage: cls
  99. X
  100. XThis command clears the screen.
  101. X
  102. X.*s 3 "color"
  103. X
  104. X.DS L
  105. Xusage: color <normal-foreground> [<normal-background>]
  106. Xusage: color -r <reverse-foreground> [<reverse-background>]
  107. X.DE
  108. X
  109. XThis command changes the current normal or reverse video colors in a
  110. Xmanner similar to the setcolor(C) command.  It has no effect on systems
  111. Xusing a monochrome monitor.  If the second (background) color is
  112. Xomitted, it is assumed to be black.
  113. X
  114. XThe command also forces normal video mode.  Refer to the
  115. X.B vidnorm
  116. Xand
  117. X.B vidrev
  118. Xcommands.
  119. XRefer also to the
  120. X.B vidcolor
  121. Xcommand.
  122. X
  123. X.DS L
  124. XColor names
  125. X   blue      magenta      brown      black
  126. X   lt_blue   lt_magenta   yellow     gray
  127. X   cyan      white        green      red
  128. X   lt_cyan   hi_white     lt_green   lt_red
  129. X.DE
  130. X.DS L
  131. XExample:
  132. X
  133. X    color lt_green  # normal video light green on black
  134. X    color -r red white # reverse video red on white
  135. X.DE
  136. X
  137. X.*s 3 "continue"
  138. X
  139. Xusage: continue
  140. X
  141. XThis command is used inside a
  142. X.B whilei
  143. Xor
  144. X.B whiles
  145. Xcompound statement to skip the remainder of any
  146. Xcommands in the loop and continue execution at the first
  147. Xcommand in the loop.
  148. X.DS L
  149. XExample:
  150. X
  151. X    send '' # send ENTER to get prompt
  152. X    whilei 1=1 # forever unless break command executed
  153. X    {
  154. X        lookfor -e 'login: ' # look for login prompt
  155. X        ifi $i0 == 0         # if we dont get prompt ...
  156. X        {
  157. X            send ''          # send ENTER again
  158. X            continue         # and look for login prompt
  159. X        }
  160. X        send $s_name         # send username
  161. X        lookfor -e 'Password:'
  162. X        send $s_password
  163. X        get -e 0 50          # wait 10 seconds for response
  164. X
  165. X        # if incorrect not found in response, ...
  166. X        if %instr($s0,'incorrect') < 0 # ... must have won
  167. X            break
  168. X
  169. X        # garbled line?: system will send another 'login: '
  170. X    }
  171. X
  172. X.DE
  173. X
  174. XNOTE: further examples of
  175. X.B continue
  176. Xusage may be found in the example for the
  177. X.B else
  178. Xcommand.
  179. X
  180. X.*s 3 "cursor"
  181. X
  182. Xusage: cursor <row> [<col>]
  183. X
  184. XThis command places the cursor at a specified position on
  185. Xthe video screen.  The top left of the scrren is row 0, column 0.
  186. XIf <col> is not specified, it is assumed 0 (left margin).
  187. X.DS L
  188. XExample:
  189. X
  190. X    cls
  191. X    $i0 = 5
  192. X    whilei $i5 < 12
  193. X    {
  194. X        cursor $i5
  195. X        echo 'This is line '+%itos($i5,2d)+' of the display'
  196. X    }
  197. X.DE
  198. X
  199. X.*s 3 "delline"
  200. X
  201. Xusage: delline
  202. X
  203. XThis command deletes the current line from the video display.
  204. X
  205. X.*s 3 "dial"
  206. X
  207. Xusage: dial <remote>
  208. X
  209. XThis command causes an outgoing call to be placed.  The string
  210. Xargument <remote> can take one of two forms: a numeric telephone
  211. Xnumber or an alphanumeric "logical" number or system name.
  212. X
  213. XA numeric phone number ('1(800)555-1212' or '2345678') must begin
  214. Xwith a digit and must consist entirely of digits, parentheses
  215. Xor hyphens.
  216. XIf a telephone number is supplied, the phone number is
  217. Xdialed; you must first have set the desired baud rate and
  218. Xparity using the 'baud' and 'parity' commands.
  219. X
  220. XIf a logical name is entered, the phone directory (managed by
  221. Xthe interactive
  222. X.B dial
  223. Xcommand) is searched;
  224. Xif the entry is found, the baud rate and parity
  225. Xis automatically set from values in the directory entry; then,
  226. Xthe number in the directory entry is dialed.
  227. X
  228. XSee the section on the interactive
  229. X"Dial" command and the section titled "Choosing a Dialout Line" for
  230. Xmore information.
  231. X
  232. XWhen the
  233. X.B dial
  234. Xcommand returns, integer variable $i0 is set to a status code
  235. Xand string variable $s0 has a text message (the modem verbal
  236. Xresult code if the ECU dialer is used, a representation of
  237. Xthe return status code if a uucp dialer is used [see below]).
  238. X.DS L
  239. X.B
  240. XDial Command $i0 Status Codes
  241. X.R
  242. X
  243. X    0  successful connect
  244. X    1  failed to connect (call progress)
  245. X    2  dial interrupted by signal
  246. X    3  modem error (non responsive or commands rejected)
  247. X.DE
  248. X.DS L
  249. X.B
  250. XDial Command $s0 Status Messages (uucp dialer)
  251. X.R
  252. X
  253. X    CONNECT ####           #### = baud rate
  254. X    BUSY                   only some modems
  255. X    NO ANSWER              only some modems
  256. X    NO CARRIER             most generic "fail to connect"
  257. X    NO DIAL TONE           only some modems
  258. X    !Connect bad baud rate modem reported different rate
  259. X    !Interrupted           call interrupted by signal
  260. X    !Invalid arguments     ECU error
  261. X    !Invalid phone number  too long or bad characters
  262. X    !Ioctl error           should not be reported here
  263. X    !Line in use           should not be reported here
  264. X    !Line open error       should not be reported here
  265. X    !Modem Error           modem did not respond
  266. X
  267. XNote: if the ECU dialer is used, the actual modem result code
  268. Xis returned in $s0 or one of the following two strings:
  269. X
  270. X    !Interrupted           call interrupted by signal
  271. X    !Modem Error           modem did not respond
  272. X.DE
  273. X
  274. X.*s 3 "do"
  275. X
  276. Xusage: do <procname> [<arg> ...]
  277. X
  278. XThis command executes a procedure whose name appears as the command's
  279. Xfirst (string) argument.  One or more arguments (up to 19) may be passed
  280. Xto the called procedure; an argument may consist of any valid string
  281. Xexpression, provided, that, when expanded,  the argument does not
  282. Xexceed 256 characters in length.
  283. X
  284. XThe called procedure may read its arguments using the
  285. X.B %argv
  286. Xstring function.  %argv(0) is the name of the procedure.
  287. XThe quantity of arguments may be obtained using the
  288. X.B %argc
  289. Xinteger function.
  290. X
  291. X.DS L
  292. XExample:
  293. X
  294. X    do 'proc' %rname %date+' '+%time %argv(0)
  295. X
  296. XNote: in this example, the called procedure is passed the name
  297. Xof the calling procedure as the last argument.
  298. X.DE
  299. X
  300. X.*s 3 "duplex"
  301. X
  302. X.DS L
  303. Xusage: duplex full | half
  304. X       duplex 'full' | 'half'
  305. X.DE
  306. X
  307. XThis command specifies whether or not ECU is to locally echo
  308. Xcharacters typed by you at the keyboard.  The overwhelming
  309. Xmajority of remote systems provide the echo function, in
  310. Xwhich case full duplex must be used.  For the rare occasions
  311. Xwhen the remote system does not echo your keyboard input,
  312. Xsetting half duplex will allow you to see what you are
  313. Xtyping.
  314. X
  315. XWhen communicating with another terminal in a "teletype
  316. Xconversation", setting half duplex is generally required.
  317. XIn such cases, use of the interactive
  318. X.B nl ,
  319. X.B nlin
  320. Xand
  321. X.B nlout
  322. Xcommands may also be required.
  323. X.DS L
  324. XExample:
  325. X
  326. X    duplex full
  327. X    $s0 = 'full'; duplex $s0
  328. X.DE
  329. X
  330. X
  331. X.*s 3 "echo"
  332. X
  333. Xusage: echo [-n] <string>
  334. X
  335. XThis command prints the contents of the string argument <string>
  336. Xon the screen.  If the -n switch is not present, a newline follows
  337. Xthe output of <string>.
  338. X.DS L
  339. XExample:
  340. X
  341. X    echo 'Procedure '+%argv(0)+' executing at '+%time
  342. X    echo -n 'Enter your first name: '; $s0 = %cgets
  343. X.DE
  344. X
  345. X.*s 3 "eeol"
  346. X
  347. Xusage: eeol
  348. X
  349. XThis command erases the video display to the end of the line.
  350. X
  351. X.*s 3 "else"
  352. X
  353. X.DF L
  354. Xusage: else <statement>
  355. X
  356. X       else
  357. X           <statement>
  358. X
  359. X       else
  360. X       {
  361. X            any kind and number of statements
  362. X       }
  363. X
  364. X       else <if> <statement>
  365. X
  366. X       else <if>
  367. X       {
  368. X            any kind and number of statements
  369. X       }
  370. X
  371. X.DE
  372. X
  373. XThis statement may follow an
  374. X.B ifi
  375. Xor
  376. X.B ifs 
  377. Xcommand to specify one or more statements to be executed if
  378. Xthe if-type command condition is false.  Else commands may be
  379. Xchained together in the traditional structured language manner.
  380. X
  381. XFor the purposes of describing this command, <statement> is
  382. Xany single or compound statement
  383. X.B NOT
  384. Xcontaining a
  385. X.B whilei
  386. Xor
  387. X.B whiles
  388. Xcommand.
  389. XIf you wish to have a while-type command executed as part of an
  390. X.B else
  391. Xcondition, the while must occur within braces ("{}").
  392. X
  393. X<if> is an
  394. X.B ifi
  395. Xor
  396. X.B ifs
  397. Xcommand followed by an <if-condition> (see the description of the
  398. X.B ifi
  399. Xor
  400. X.B ifs
  401. Xcommands below).
  402. X.DS L
  403. XExample:
  404. X
  405. X#+------------------------------------------------------
  406. X# finger.ep - procedure to send 'finger' to remote
  407. X# BSD Unix system; print resulting lines in different
  408. X# colors: uucp logins green, root red, others cyan
  409. X#-------------------------------------------------------
  410. X
  411. X    mkvar $icolor; $icolor = %colors
  412. X    mkvar $itimeout
  413. X    $itimeout = 50     # timeout for first line 5 secs
  414. X    send 'ps -aux'     # send command, but do not echo
  415. X    lookfor '\n' 40    # swallow command
  416. X    whilei 1==1        # forever, or until break
  417. X    {
  418. X        lgets 0 $itimeout 1 '\n' #get a line
  419. X        ifi $i0 = 0 break #if no chaacters read
  420. X        $itimeout = 10 #wait 1 sec for later lines
  421. X
  422. X        ifi %instr($s0,'% ') >= 0 # if csh prompt seen
  423. X            break                 # exit while loop
  424. X        else ifi %instr($s0,'Login') >= 0
  425. X            color gray
  426. X        else ifi %instr($s0,'root') >= 0
  427. X            color red
  428. X        else ifi %instr($s0,'uucp') >= 0
  429. X            color green
  430. X        else color cyan
  431. X        echo $s0
  432. X    }
  433. X    icolor $icolor #restore entry colors
  434. X    send ''        #force a new prompt from remote
  435. X
  436. X.DE
  437. X
  438. X.*s 3 "exit"
  439. X
  440. Xusage: exit [<status>]
  441. X
  442. XThis command causes an abrupt termination of the ECU program.
  443. XAny existing connection with a remote system
  444. Xis terminated immediately.
  445. XIf no integer argument <status> is found, ECU exits
  446. Xwith a program exit status of 0.
  447. XIf <status> is found and the value is zero, then ECU exits
  448. Xwith a program exit status of 0.
  449. XIf <status> non-zero,its value must be in the range of 1 to 31,
  450. Xand ECU exits
  451. Xwith a program exit status of 192 plus <status>.
  452. XThis feature allows batch executions of ECU by shell script
  453. Xdetect user-determined ECU execution status.
  454. XSee the section titled "Exit Codes".
  455. X
  456. X.*s 3 "expresp"
  457. X
  458. Xusage: expresp [-v[v...]] <exp-resp-str> [<timeout_msecs>]
  459. X
  460. XThis command emulates the uuchat function as described in the
  461. XSCO HDB UUCP documentation and in the /usr/lib/uucp/Dialers
  462. Xfile.
  463. X
  464. X-v causes the expect-respond conversation between ECU and the
  465. Xremote system to be displayed on the screen.  This switch is
  466. Xautomatically enabled if procdedure tracing is enabled.
  467. X
  468. Xmultiple v's (e.g., -vv, -vvv) up to 3 'v's produce
  469. Xmore verbose debug output. -vv causes each base level
  470. Xexpect and respond string to be displayed. -vvv causes
  471. Xa hexadecimal dump of each  interpreted expect string to be
  472. Xdisplayed.
  473. X
  474. X<exp-resp-str> is as defined in /usr/lib/ecu/Dialers.
  475. X.DS L
  476. X   Meaning of some of the escape characters:
  477. X   \\\p - pause (approximately 1/4-1/2 second delay)
  478. X   \\\d - delay (2 seconds)
  479. X   \\\D - phone number/token
  480. X   \\\T - phone number with Dialcodes and character translation
  481. X   \\\N - null byte
  482. X   \\\K - insert a BREAK
  483. X   \\\E - turn on echo checking (for slow devices)
  484. X   \\\e - turn off echo checking
  485. X   \\\r - carriage return
  486. X   \\\c - no new-line
  487. X   \\\n - send new-line
  488. X   \\\nnn - send octal number
  489. X   \\\m## - delay ## milliseconds (NOT SUPPORTED BY DIALERS;
  490. X            SEE BELOW)
  491. X   ~t[##] - set timeout to ## seconds (see below)
  492. X   ~m[##] - set timeout to ## milliseconds (see below)
  493. X   Speed - Hayes-specific speed-adaptive connect handler
  494. X.DE
  495. X
  496. X<timeout_msecs> specifies an optional timeout in milliseconds
  497. Xfor waiting on expect strings;  it defaults to 10,000 milliseconds
  498. X(10 seconds).
  499. XThe resolution for timeouts is limited to the basic tick time of
  500. Xyour system (HZ, 10 msec for UNIX/386, 20 msec for XENIX/386 and XENIX/286).
  501. XThe timeout for 'Speed' expects is fixed at 90 seconds.
  502. X
  503. X\\\m### causes a ### millisecond delay.  Note this adds an ambiguity to
  504. Xthe syntax of the send string: you may not follow an \m delay with a
  505. Xliteral digit to send.  For example, suppose you wish to delay 300
  506. Xmissileconds then send "4A".  \\\m3004A will delay for 3004
  507. X(approximately) milliseconds, then send an "A". 
  508. X
  509. XInteger variable $i0 is set to one if the expect-respond script 
  510. Xfails, else it is set to 0.
  511. X
  512. X
  513. X.*s 3 "fchmod"
  514. X
  515. Xusage: fchmod <mode> <file>
  516. X
  517. XThis command sets the mode of <file> to <mode>.
  518. XThe <mode> argument takes one of two forms, a nine-character
  519. Xmode string (e.g., 'rwxr-xr-x') or an integer value (0755).
  520. XThe <file> argument is either a string value forming a
  521. Xfilename or an integer file number representing a file opened with the
  522. X.B fopen
  523. Xcommand.
  524. X
  525. XThe command sets $i0 = 0 if successful, else to the
  526. X.B errno
  527. Xfrom the associated system call (refer to the 
  528. X.B %errstr
  529. Xstring function and/or /usr/include/sys/errno.h).
  530. X
  531. X.DS L
  532. XExample:
  533. X
  534. X    fopen 1 '/tmp/123'; fchmod 'rwxrwxrwx' 1
  535. X    fchmod 'rwxrwxrwx' '/tmp/123'
  536. X    fopen 1 '/tmp/123'; fchmod 0777 1
  537. X    $i0 = 0777; fchmod $i0 '/tmp/123'
  538. X
  539. XAll of the above example result in the same result.
  540. X.DE
  541. X
  542. X.*s 3 "fclose"
  543. X
  544. Xusage: fclose <file>
  545. X
  546. XThis command closes <file>.
  547. XThe <file> argument is an
  548. Xinteger file number representing a file opened with the
  549. X.B fopen
  550. Xcommand.
  551. X
  552. XThe command is ignored if <file> is not open.
  553. XNo integer variable is modified by
  554. X.I fclose .
  555. X
  556. X.DS L
  557. XExample:
  558. X
  559. X    fclose 1
  560. X.DE
  561. X
  562. X.*s 3 "fdel"
  563. X
  564. Xusage: fdel <file>
  565. X
  566. XThis command removes a file.
  567. X
  568. XThe command sets $i0 = 0 if successful, else to the
  569. X.B errno
  570. Xfrom the associated system call (refer to the 
  571. X.B %errstr
  572. Xstring function and/or /usr/include/sys/errno.h).
  573. X
  574. X.DS L
  575. XExample:
  576. X
  577. X    fdel '/tmp/123'
  578. X.DE
  579. X
  580. X.*s 3 "fgetc"
  581. X
  582. Xusage: fgetc <file> <destination>
  583. X
  584. XThis command reads a character from <file>.
  585. XThe <file> argument is an
  586. Xinteger file number representing a file opened with the
  587. X.B fopen
  588. Xcommand.
  589. X
  590. XThe argument <destination> is either a string variable
  591. Xor an integer variable.
  592. XIf the file has reached end of file: an integer variable
  593. Xreceives -1; a string variable is returned null.
  594. XOtherwise, the character's numeric value (0-255) is placed
  595. Xin an integer variable or a string variable is returned with a
  596. Xlength of one with the file character as its only character.
  597. X
  598. X.DS L
  599. XExample:
  600. X
  601. X    fgetc 1 $s0
  602. X    fgetc 1 $i_input
  603. X.DE
  604. X
  605. X.*s 3 "fgets"
  606. X
  607. Xusage: fgets <file> <strvar>
  608. X
  609. XThis command reads a character from <file>.
  610. XThe <file> argument is an
  611. Xinteger file number representing a file opened with the
  612. X.B fopen
  613. Xcommand.
  614. X
  615. XThe argument <strvar> is a string variable.
  616. XIf the file has reached end of file, <strvar> is returned null and
  617. Xinteger variable $i0 is set to 1.
  618. XOtherwise, the <strvar> receives input from the file minus
  619. Xthe trailing newline and $i0 is returned zero.
  620. X
  621. X.DS L
  622. XExample:
  623. X
  624. X    fgets 1 $s0
  625. X.DE
  626. X
  627. X.*s 3 "fkey"
  628. X
  629. Xusage: fkey <str>
  630. X
  631. XThis command selects a function key definition from the ~/.ecu/keys
  632. Xfile.
  633. X
  634. X.*s 3 "flush"
  635. X
  636. Xusage: flush
  637. X
  638. XThis command causes any characters received by the system
  639. Xfrom the line, but not yet read by the procedure to be "forgotten"
  640. Xor flushed.
  641. X
  642. X.*s 3 "fopen"
  643. Xusage: fopen [-switches] <filenum> <filename>
  644. X
  645. XThis command opens a file named by the string argument <filename>
  646. Xand associates it with the user-chosen file number <filenum> (which
  647. Xmust be an integer value between 0 and 4, inclusive).
  648. X
  649. XThe argument switches govern how a file is opened and must be chosen
  650. Xfrom this list:
  651. X.VL 15 4
  652. X.LI -r
  653. XThe file is opened read-only; if it does not
  654. Xexist, an error occurs.
  655. X.LI -r+
  656. XThe file is opened for reading and writing; if it does not
  657. Xexist, an error occurs.
  658. X.LI -w
  659. XThe file is opened for writing (any previous contents
  660. Xof the file are lost); if it does not
  661. Xexist, it is created.
  662. X.LI -w+
  663. XThe file is opened for reading and writing (any previous contents
  664. Xof the file are lost); if it does not
  665. Xexist, it is created.
  666. X.LI -a
  667. XThe file is opened for appending (writes to the file
  668. Xare added to the previous file contents); if it does not
  669. Xexist, it is created.
  670. XAll writes are appended to the file (the
  671. X.B fseek
  672. Xcommand has no effect).
  673. X.LE
  674. X
  675. XThe switches parameter may be omitted; in such cases,
  676. Xthe file is opened as though '-r' had been supplied.  However,
  677. Xif procedure tracing is enabled (see the description of the
  678. Xinteractive and procedure command
  679. X.B ptrace ),
  680. Xa warning message will be issued.
  681. X
  682. XThe command sets $i0 = 0 if successful, else to the
  683. X.B errno
  684. Xfrom the associated system call (refer to the 
  685. X.B %errstr
  686. Xstring function and/or /usr/include/sys/errno.h).
  687. X.DS L
  688. XExample:
  689. X
  690. X    fopen 0 -r '/etc/passwd'
  691. X    fopen 1 -w+ '/tmp/123'
  692. X    fopen 2 -a 'tranact.log'
  693. X.DE
  694. X
  695. X.*s 3 "fputc"
  696. X
  697. Xusage: fputc <file> <char>
  698. X
  699. XThis command writes character <char> into <file>.
  700. XThe <file> argument is an
  701. Xinteger file number representing a file opened with the
  702. X.B fopen
  703. Xcommand.
  704. XArgument <char> is a integer value of which the lower eight
  705. Xbits are used or a string value of which the first character is used.
  706. X
  707. XIf a write error occurs, procedure execution is terminated.
  708. X.DS L
  709. XExample:
  710. X
  711. X    $s0='abc'; fputc 1 $s0        writes 'a'
  712. X    $i0=0x30 ; fputc 1 $i0        writes '0'
  713. X.DE
  714. X
  715. X.*s 3 "fputs"
  716. X
  717. Xusage: fputs [-n] <file> <str>
  718. X
  719. XThis command writes the string <str> into <file>.
  720. XThe <file> argument is an
  721. Xinteger file number representing a file opened with the
  722. X.B fopen
  723. Xcommand.
  724. X
  725. XIf the switch '-n' is omitted, a newline is appended after <str>
  726. Xin the file; if present, no newline is written.
  727. X
  728. XIf a write error occurs, procedure execution is terminated.
  729. X.DS L
  730. XExample:
  731. X
  732. X    $s0='abc'; fputc 1 $s0        writes 'a'
  733. X.DE
  734. X
  735. X.*s 3 "fseek"
  736. X
  737. Xusage: fseek <file> <position>
  738. X
  739. XThis command sets the file position of <file> to <position.
  740. XThe corresponding integer function
  741. X.B %ftell
  742. Xmay be used to determine the current file position.
  743. X
  744. X.B Note :
  745. Xif <file> is open for append ('-a'), then the
  746. X.B fseek
  747. Xcommand will have no effect.
  748. X
  749. X.*s 3 "getf"
  750. X
  751. X.DS L
  752. Xusage: getf -x <int-var-spec> <offset>
  753. X
  754. Xwhere: -x ==
  755. X   -b byte
  756. X   -w word (little-endian)
  757. X   -W word (big-endian)
  758. X   -l 32-bits (little-endian)
  759. X   -L 32-bits (big-endian)
  760. X.DE
  761. X
  762. X.*s 3 "gosub"
  763. X
  764. Xusage: gosub <label>
  765. X
  766. XThis command transfers control of procedure to a statement
  767. Xother than the one immediately following.  The <label>
  768. Xargument may be literal text or may be a string, allowing
  769. Xa "computed gosub" feature.
  770. X
  771. XWhen the next return statement is executed, control is
  772. Xreturned to the 
  773. Xnext statement after the gosub.
  774. X
  775. X.DS L
  776. XExample:
  777. X
  778. X    gosub GET_NEXT
  779. X    gosub 'GET_NEXT'
  780. X    gosub 'GET'+'_NEXT'
  781. X    $s0 = 'GET_NEXT'; gosub $s0
  782. X    $s0 = 'NEXT'; gosub 'GET_'+$s0
  783. X
  784. XNote: all the above examples cause transfer to the label GET_NEXT.
  785. X
  786. XExample:
  787. X
  788. X#---------------------
  789. X# gosub.ep
  790. X#---------------------
  791. X    echo 'main'; gosub SUB; echo 'back to main'
  792. X    return
  793. X
  794. XSUB
  795. X    echo 'sub'
  796. X    gosub SUB2
  797. X    echo 'back to sub'
  798. X    return
  799. X
  800. X
  801. XSUB2
  802. X    echo 'sub2'
  803. X    return
  804. X
  805. X.DE
  806. X
  807. X.*s 3 "gosubb"
  808. X
  809. Xusage: gosubb <label>
  810. X
  811. XThis command serves the same function as the
  812. X.B gosub
  813. Xcommand except the programmer is signifying that the label
  814. Xis
  815. X.B b ehind
  816. Xthe current statement, resulting in slightly faster execution.
  817. X(The label is not REQUIRED to be at any specific location
  818. Xin the procedure relative to the
  819. X.B gosubb
  820. Xstatement.)
  821. X
  822. X.*s 3 "goto"
  823. X
  824. Xusage: goto <label>
  825. X
  826. XThis command transfers control of procedure to a statement
  827. Xother than the one immediately following.  The <label>
  828. Xargument may be literal text or may be a string, allowing
  829. Xa "computed goto" feature.
  830. X.DS L
  831. XExample:
  832. X
  833. X    goto GET_NEXT
  834. X    goto 'GET_NEXT'
  835. X    goto 'GET'+'_NEXT'
  836. X    $s0 = 'GET_NEXT'; goto $s0
  837. X    $s0 = 'NEXT'; goto 'GET_'+$s0
  838. X.DE
  839. XNote: all the above examples cause transfer to the label GET_NEXT.
  840. X
  841. X.*s 3 "gotob"
  842. X
  843. Xusage: gotob <label>
  844. X
  845. XThis command serves the same function as the
  846. X.B goto
  847. Xcommand except the programmer is signifying that the label
  848. Xis
  849. X.B b ehind
  850. Xthe current statement, resulting in slightly faster execution.
  851. X(The label is not REQUIRED to be at any specific location
  852. Xin the procedure relative to the
  853. X.B gotob
  854. Xstatement.)
  855. X
  856. X.*s 3 "hangup"
  857. X
  858. Xusage: hangup
  859. X
  860. XThis command causes Data Terminal Ready (DTR)
  861. Xto be dropped momentarily, causing (hopefully)
  862. Xthe termination of any current connection
  863. Xto a remote system. 
  864. XThis command is only effective if the attached Data Communications
  865. XEquipment is configured
  866. Xto terminate its connection on loss of DTR.
  867. X
  868. XIf no line is attached, the command is ignored (a warning
  869. Xis generated if procedure tracing is enabled).
  870. X
  871. X.*s 3 "hexdump"
  872. X.DS L
  873. Xusage: hexdump [-s] <str>
  874. X       hexdump -t[s] <str1> <str>
  875. X.DE
  876. X
  877. X<str> buf to dump
  878. X<str1> title (if -t)
  879. X-s short (terse) dump
  880. X
  881. XThis command prints a hexadecimal dump of <str> on the screen
  882. X(and to the procedure log file, if logging enabled with the
  883. X.B ptrace
  884. Xcommand).
  885. X
  886. XThe switch '-t' signifies that <str1> is a title to be printed
  887. X.DS L
  888. XExample:
  889. X
  890. X    $s0='The quick brown fox jumped over the lazy dog\'s back'
  891. X    hexdump -t 'Example hex dump' $s0
  892. X---------------------------- Example hex dump ----------------------------
  893. X0000  54 68 65 20 71 75 69 63 6B 20 62 72 6F 77 6E 20 | The quick brown  |
  894. X0010  66 6F 78 20 6A 75 6D 70 65 64 20 6F 76 65 72 20 | fox jumped over  |
  895. X0020  74 68 65 20 6C 61 7A 79 20 64 6F 67 27 73 20 62 | the lazy dog's b |
  896. X0030  61 63 6B                                        | ack              |
  897. X.DE
  898. X.DS L
  899. X    hexdump %left($s0,9)
  900. X0000  54 68 65 20 71 75 69 63 6B                      | The quick        |
  901. X.DE
  902. X.DS L
  903. X    hexdump -ts 'Example hex dump' %left($s0,9)
  904. XExample hex dump
  905. X0000  54 68 65 20 71 75 69 63 6B | The quick |
  906. X.DE
  907. X.DS L
  908. X    hexdump -s %left($s0,9)
  909. X0000  54 68 65 20 71 75 69 63 6B | The quick |
  910. X.DE
  911. X
  912. X.*s 3 "home"
  913. X
  914. Xusage: home
  915. X
  916. XThis command homes the video cursor.
  917. X
  918. X.*s 3 "icolor"
  919. X
  920. Xusage: icolor <int-colors>
  921. X
  922. XThis command sets the normal and reverse foreground
  923. Xand background colors according to <int-colors>, an integer
  924. Xvalue in the format as that returned by the
  925. X.B %colors
  926. Xinteger function.
  927. X
  928. XThis command is provided primarily to be able to save the color
  929. Xstate, modify it temporarily and then restore it.
  930. X.DS L
  931. XExample:
  932. X
  933. X    mkvar $icolor_save; $icolor_save = %colors
  934. X    color red; echo 'Connection seems to be dead'
  935. X    icolor $icolor_save # restore previous colors
  936. X.DE
  937. X
  938. X.*s 3 "ifi"
  939. X.DS L
  940. Xusage: ifi <int> <rel-op> <int> <statement>
  941. X       ifi <int> <rel-op> <int>
  942. X           <statement>
  943. X       ifi <int> <rel-op> <int>
  944. X       {
  945. X           any kind or number of statements
  946. X       }
  947. X.DE
  948. X
  949. XThis command selectively executes one or more statements
  950. Xbased on a test of two integer quantities.  See the
  951. Xdescription of the
  952. X.B break ,
  953. X.B continue ,
  954. Xand
  955. X.B else
  956. Xcommmands for examples of how the command is used.
  957. X
  958. X.*s 3 "ifs"
  959. X.DS L
  960. Xusage: ifs <str> <rel-op> <str> <statement>
  961. X       ifs <int> <rel-op> <int>
  962. X           <statement>
  963. X       ifs <int> <rel-op> <int>
  964. X       {
  965. X           any kind or number of statements
  966. X       }
  967. X.DE
  968. X
  969. XThis command selectively executes one or more statements
  970. Xbased on a test of two string values.  See the
  971. Xdescription of the
  972. X.B break ,
  973. X.B continue ,
  974. Xand
  975. X.B else
  976. Xcommmands
  977. Xand many other examples throughout the document,
  978. Xfor examples of how the command is used.
  979. X
  980. X.*s 3 "lbreak"
  981. X
  982. Xusage: lbreak
  983. X
  984. XThis command transmits a break to the remote system.
  985. X
  986. X.*s 3 "lgets"
  987. X
  988. X.DS L
  989. Xusage: lgets [-er] <strvar> <t1-int> <t2-int> [<stop-str>]
  990. X
  991. X-e echo received characters to screen
  992. X-r raw read (retain carriage returns)
  993. X.DE
  994. X
  995. XThis command reads a string from the attached communications
  996. Xline.
  997. X<t1-int> is the number of tenths of seconds before
  998. Xtiming out waiting for the first character to be received.
  999. X<t2-int> is the number of tenths of seconds before
  1000. Xtiming out on later characters.
  1001. X<stop-str> is an optional argument, which if received, immediately
  1002. Xterminates the read.
  1003. XInteger variable $i0 is set to the count of characters received.
  1004. X
  1005. XIf the specified string variable is filled with characters
  1006. Xbefore the <stop-str> has been encountered or before a timeout
  1007. Xoccurs, then the command returns with $i0 set to the maximum
  1008. Xsize of the variable.  Refer to the section on string variables
  1009. Xabove and the section describing the
  1010. X.B mkvar
  1011. Xcommand below for information on the size of string variables.
  1012. X
  1013. X.*s 3 "insline"
  1014. X
  1015. Xusage: insline
  1016. X
  1017. XThis command inserts a line onto the video screen at the current line.
  1018. X
  1019. X.*s 3 "logevent"
  1020. X.DS L
  1021. Xusage: logevent <str>
  1022. X.DE
  1023. X
  1024. XThis command writes a log item to ~/.ecu/log.
  1025. X
  1026. X.DS L
  1027. XExample:
  1028. X
  1029. X    $s0='/tmp/alm.log'
  1030. X    log 'appending alarm info to '+$s0
  1031. X
  1032. Xwrites:
  1033. X10-02-1989-17:39-01261-PROC appending alarm info to /tmp/alm.log
  1034. X.DE
  1035. Xassuming the transmitter process pid is 1261 and you are living in
  1036. X1989.
  1037. X.*s 3 "lookfor"
  1038. X.DS L
  1039. Xlookfor [-e] [quiet | <str>] [<timeout-int>]
  1040. X
  1041. X-e echo to screen while "looking"
  1042. X.DE
  1043. XThis command is used to read from the attached commuications line
  1044. Xuntil one of two user-specified conditions occurs.
  1045. X
  1046. XThe 'quiet' option waits for the line to become
  1047. Xquiet for the number of tenths of seconds specified  by <timeout-int>.
  1048. X
  1049. XThe other option reads the line until <str> is read from the line
  1050. Xor until <timeout-int> tenths of seconds elapses.  With this option,
  1051. Xinteger variable $i0 is set to 1 if <str> is found within the
  1052. Xtimeout period or 0 if not.
  1053. X
  1054. X.DS L
  1055. XExamples:
  1056. X
  1057. X    lookfor -e quiet 20   wait for quiet line for 2 secs
  1058. X    lookfor 'word:' 50    wait for 'word:' for up to 5 secs
  1059. X.DE
  1060. X.*s 3 "mkvar"
  1061. X.DS L
  1062. Xusage: mkvar [$]i<name>
  1063. X       mkvar [$]s<name>(<size>)
  1064. X.DE
  1065. X
  1066. XThis command creates one or more named (temporary)
  1067. Xinteger or string variables.
  1068. XThe variable type is determines by the first character
  1069. Xof the variable, which must be 'i' or 's'.  The size of a string
  1070. Xvariable must be specified via the <size> argument.  An optional '$'
  1071. Xmay be supplies for neatness, but may be omitted if desired.
  1072. X
  1073. X.*s 4 "Variable Names"
  1074. X
  1075. XThe names for created (named, temporary) variables consist of
  1076. Xa dollar sign ('$'), an 'i' for integer or 's' for string and
  1077. Xup to fifteen characters from the set [A-Za-z0-9_].
  1078. X
  1079. XThe first character after the 'i' or 's' in <name> 
  1080. Xmust be non-numeric.  '$sxyz' and '$s_3xyz' are legal, but '$s3xyz'
  1081. Xis not (it would be interpreted as '$s3' followed by the illegal
  1082. Xcommand sequence 'xyz').
  1083. X
  1084. XThe <name> space for integer and string variables are separate.
  1085. XIt is possible to have an integer variable named '$ixyz' and a string
  1086. Xvariable named '$sxyz'.  
  1087. X
  1088. X.*s 4 "Variable Life and Scope"
  1089. X
  1090. XThe life and scope of created variables is for
  1091. Xthe duration of the execution
  1092. Xof the creating procedure.  Procedures called
  1093. Xby the creating procedure (by 'do') can reference
  1094. Xtemporary variables declared by a
  1095. Xprevious procedure.  When created, integer variables are set
  1096. Xto zero and string variables are set to zero length.
  1097. XThese features differ from numbered variables
  1098. Xwhich retain their scope and values at all times, even when
  1099. Xprocedure execution terminates and ECU returns to interactive mode.
  1100. X
  1101. XVariables may be created by the same name more than once.
  1102. XThe latest mkvar execution specifies the variable referenced.
  1103. XThus if proc1 declares '$ixx' and calls proc2 which also declares '$ixx',
  1104. Xproc2's variable is distinct from proc1's and disappears when proc2
  1105. Xterminates, thus making proc1's available to it again, containing
  1106. Xthe same value as it had at the time proc2 was called.
  1107. X
  1108. X.*s 4 "String Variable Size"
  1109. X
  1110. XThe maximum value for <size> is 5120.
  1111. XRegardless of the size specified in the creation of a string
  1112. Xvariable, ECU will expand it's size as necessary up to the 5120
  1113. Xcharacter maximum.
  1114. X
  1115. X.DS L
  1116. XExamples:
  1117. X
  1118. X    mkvar i_count
  1119. X    mkvar $i_count
  1120. X    mkvar s20(20),s80(80),i_timeout,$i_colors
  1121. X.DE
  1122. X
  1123. X.*s 3 "nap"
  1124. Xusage: nap <int>
  1125. X       nap -m <int>
  1126. X
  1127. XThis command suspends procedure execution for <int> tenths of
  1128. Xseconds if 
  1129. X.B -m
  1130. Xis not specified.
  1131. XIf -m is used, execution is suspended for <int> milliseconds.
  1132. XNote: the actual period execution is suspended depends, as usual,
  1133. Xon the scheduling load of the system.  For small -m values, be aware
  1134. Xthat the granularity of the nap duration is set by the system,
  1135. X20 milliseconds for XENIX 286 and 386, 10 milliseconds for UNIX.
  1136. X
  1137. XIf you need to know the frequency of the system clock,
  1138. Xsomething like
  1139. X.DS L
  1140. X      $i0 = %stoi(%getenv("HZ"))
  1141. X.DE
  1142. Xwill obatin the value for you (provided HZ is in the process' environment).
  1143. X
  1144. X
  1145. X.DS L
  1146. XExamples:
  1147. X
  1148. X    nap 30
  1149. X    nap $i0*$i2
  1150. X    nap -m 50
  1151. X.DE
  1152. X
  1153. X.*s 3 "parity"
  1154. X.DS L
  1155. Xusage: parity [even | odd | none]
  1156. X       parity <str>
  1157. X.DE
  1158. X
  1159. XThis command sets the parity for the attached communications line.
  1160. XIf <str> is supplied, the first character must be 'e', 'o' or 'n'.
  1161. XUppercase equivalents are also accepted.
  1162. X
  1163. X.DS L
  1164. XExamples:
  1165. X
  1166. X    parity even
  1167. X    parity 'e'
  1168. X    parity 'Even now as we speak'
  1169. X.DE
  1170. X
  1171. X.*s 3 "pclose"
  1172. Xusage: pclose <filenum>
  1173. X
  1174. XThis command should be issued when a command started by the
  1175. Xinteractive
  1176. X.B popen
  1177. Xcommandf completes.
  1178. X
  1179. X.*s 3 "plog"
  1180. X.DS L
  1181. Xusage: plog
  1182. X       plog <str>
  1183. X       plog off
  1184. X.DE
  1185. X
  1186. XThis command controls logging to a file of the screen output during
  1187. Xprocedure execution.  With no argument, the command displays the status
  1188. Xof logging.  <str> specifies a log file pathname, while the 'off'
  1189. Xargument turns logging off.
  1190. X
  1191. XIf procedure execution terminates due to an error, procedure logging
  1192. Xis turned off.  However, if procedure execution terminates
  1193. Xnormally while logging is active, erratic and unpredictable portions
  1194. Xof interactive mode screen output will continue to be logged to
  1195. Xthe current log file.
  1196. X
  1197. XThe interactive mode command
  1198. X.B plog
  1199. Xmay also be used to control procedure logging.
  1200. X.DS L
  1201. XExample:
  1202. X
  1203. X    mkvar s_logname(128)
  1204. X    $s_logname = %dir+'logname'
  1205. X    plog $s_logname
  1206. X    echo 'Test'
  1207. X    plog off;cd 'somewhere_else';plog $s_logname
  1208. X    echo 'Test'
  1209. X.DE
  1210. X
  1211. X.*s 3 "popen"
  1212. Xusage: popen [-switches] <filenum> <command>
  1213. X
  1214. XThis command executes a shell command defined by the string argument <command>
  1215. Xand associates it with the user-chosen file number <filenum> (which
  1216. Xmust be an integer value between 0 and 4, inclusive).
  1217. X
  1218. XThe argument switches govern whether the command is
  1219. Xto receive input from ECU or output to ECU and must be chosen
  1220. Xfrom this list:
  1221. X.VL 15 4
  1222. X.LI -r
  1223. XThe command will output to ECU.
  1224. X.LI -w
  1225. XThe command will receive input from ECU.
  1226. X.LE
  1227. X
  1228. XThe switches parameter may be omitted; in such cases,
  1229. Xthe file is opened as though '-r' had been supplied.  However,
  1230. Xif procedure tracing is enabled (see the description of the
  1231. Xinteractive and procedure command
  1232. X.B ptrace ),
  1233. Xa warning message will be issued.
  1234. X
  1235. XThe command sets $i0 = 0 if successful, else to the
  1236. X.B errno
  1237. Xfrom the associated system call (refer to the 
  1238. X.B %errstr
  1239. Xstring function and/or /usr/include/sys/errno.h).
  1240. X.DS L
  1241. XExample:
  1242. X
  1243. X    popen 0 -r 'ls -l *.log'
  1244. X    popen 1 -w 'cat | sort > /tmp/sorted'
  1245. X.DE
  1246. X
  1247. X
  1248. X.*s 3 "prompt"
  1249. Xusage: prompt <str>
  1250. X
  1251. XThis command allows selection of an alternate prompt to the interactive
  1252. Xmode HOME command trigger.
  1253. XRefer to the section titled "ECUPROMPT"
  1254. Xfor more information on the interactive mode prompt.
  1255. X
  1256. XNote: the interactive and procedure
  1257. X.B hangup
  1258. Xcommands both cause the default prompt to be reestablished.
  1259. X
  1260. X.DS L
  1261. XExample:
  1262. X
  1263. X     prompt %rname+' >'    use remote name in prompt
  1264. X.DE
  1265. X
  1266. X.*s 3 "ptrace"
  1267. X.DS L
  1268. Xusage: ptrace [ <str> | off ]
  1269. X.DE
  1270. X
  1271. XThis command controls procedure execution tracing.  Trace
  1272. Xoutput is written to the screen and varys in its nature depending upon
  1273. Xthe command being traced.  Specifically, any change to a string or
  1274. Xinteger variable is noted.  If tracing is enabled, the output will also
  1275. Xbe written to any active procedure log file (see the
  1276. X.B plog
  1277. Xinteractive and procedure commands).
  1278. X
  1279. X.*s 3 "putf"
  1280. X
  1281. XNot yet implemented.
  1282. X
  1283. X.*s 3 "return"
  1284. Xusage: return [<int>]
  1285. X
  1286. XThis command serves two functions: to return from a gosub to or
  1287. Xreturn from a procedure execution.
  1288. X
  1289. XIf no gosub is active,
  1290. X.B return
  1291. Xcauses the currently executing procedure to terminate,
  1292. Xreturning either to a calling procedure or to the interactive mode.
  1293. XIf <int> is supplied and it's value is nonzero, then all procedure execution is
  1294. Xterminated and the integer status is printed
  1295. Xon the screen along with the name of the executing procedure.
  1296. X
  1297. XIf a gosub is active,
  1298. X.B return
  1299. Xor
  1300. X.B return
  1301. X0 causes control to return to the statement immediately following the
  1302. X.B gosub
  1303. Xwhich invoked the subroutine.
  1304. XIf <int> is supplied and it's value is nonzero, then all procedure execution is
  1305. Xterminated and the integer status is printed
  1306. Xon the screen along with the name of the executing procedure.
  1307. X
  1308. XIt is not possible to terminate a procedure with normal status from
  1309. Xwithin a subroutine.
  1310. X
  1311. X.DS L
  1312. XExample:
  1313. X
  1314. X#---------------------
  1315. X# gosub.ep
  1316. X#---------------------
  1317. X    echo 'main'; gosub SUB; echo 'back to main'
  1318. X    return
  1319. X
  1320. XSUB
  1321. X    echo 'sub'
  1322. X    gosub SUB2
  1323. X    echo 'back to sub'
  1324. X    return
  1325. X
  1326. X
  1327. XSUB2
  1328. X    echo 'sub2'
  1329. X    return
  1330. X
  1331. X.DE
  1332. X
  1333. X.*s 3 "rk"
  1334. Xusage: rk [-a]
  1335. X
  1336. XThis command invokes the Kermit file receive protocol.  If switch '-a'
  1337. Xis omitted, the received files are stored as received; otherwise
  1338. Xcarriage return/linefeed pairs are converted to newlines.
  1339. XThe remote sender must have been started prior the the
  1340. Xexecution of this command.
  1341. X
  1342. X.*s 3 "rname"
  1343. Xusage: rname <str>
  1344. X
  1345. XNormally, the %rname string function returns the same string
  1346. Xas the logical dialing directory entry.  This command allows
  1347. Xthe default value to be overridden with a user-selected
  1348. Xvalue (63-character maximum).
  1349. X
  1350. XThis feature is useful in situations where one system is initially
  1351. Xdialed, but a connection is made to yet another system from the dialed
  1352. Xsystem via networking.
  1353. X
  1354. X.*s 3 "rs"
  1355. Xusage: rs
  1356. X
  1357. XThis command invokes the SEAlink file receive protocol.
  1358. XThere
  1359. Xis no provision in the SEAlink protocol to convert
  1360. Xcarriage return/linefeed pairs to newlines,
  1361. Xso the received files are stored as received.
  1362. XThe remote sender must have been started prior the the
  1363. Xexecution of this command.
  1364. X
  1365. X.*s 3 "rtscts"
  1366. Xusage: rtscts [ off| on | no | yes | 0 | 1 | 2 | 3 ]
  1367. X
  1368. XThis command control RTS/CTS hardware flow control,
  1369. Xwhich may or may not work with your serial driver.
  1370. XWhat the command does is to manipulate the RTSFLOW and CTSFLOW
  1371. Xbits of the termio c_cflag word (see 
  1372. X.B termio(S) ).
  1373. X
  1374. X.DS I
  1375. Xargument | RTSFLOW | CTSFLOW
  1376. X---------+---------+---------
  1377. X  off    |   0     |   0
  1378. X  on     |   1     |   1
  1379. X  no     |   0     |   0
  1380. X  yes    |   1     |   1
  1381. X  0      |   0     |   0
  1382. X  1      |   1     |   1
  1383. X  2      |   1     |   0
  1384. X  3      |   0     |   1
  1385. X
  1386. X.DS L
  1387. XExamples:
  1388. X
  1389. X    ifi %baud >= 9600
  1390. X        rtscts on
  1391. X    else ifi $i_do_both_flow_control_anyway != 0
  1392. X        rtscts on
  1393. X    else ifi $i_do_input_flow_control_anyway != 0
  1394. X        rtscts 2
  1395. X    else ifi $i_do_output_flow_control_anyway != 0
  1396. X        rtscts 3
  1397. X    else
  1398. X        rtscts off
  1399. X.DE
  1400. X
  1401. X.*s 3 "rx"
  1402. Xusage: rx [-a] <str>
  1403. X
  1404. XThis command invokes the XMODEM file receive protocol
  1405. Xto receive file <str>.  If switch '-a'
  1406. Xis omitted, the received file is stored as received; otherwise
  1407. Xcarriage return/linefeed pairs are converted to newlines.
  1408. XThe remote sender must have been started prior the the
  1409. Xexecution of this command.
  1410. X
  1411. X.*s 3 "ry"
  1412. Xusage: ry
  1413. X
  1414. XThis command invokes the YMODEM Batch (not to be confused with
  1415. XXMODEM-1K) protocol to receive files from a remote system.  The remote
  1416. Xsender must have been started prior the the execution of this command.
  1417. X
  1418. X.*s 3 "rz"
  1419. Xusage: rz
  1420. X
  1421. XThis command invokes the ZMODEM protocol to receive
  1422. Xfiles from a remote system.
  1423. XThe remote sender must have been started prior the the
  1424. Xexecution of this command.
  1425. X
  1426. X.*s 3 "scrdump"
  1427. Xusage: scrdump [<str>]
  1428. X
  1429. XThis command causes the current screen contents to be
  1430. Xstored in a file.  If <str> is supplied, it is used as a pathname.
  1431. XIf <str> is not supplied, "~/.ecu/screen.dump".
  1432. XThe actions of the interactive
  1433. X.B sdname
  1434. Xcommand have no effect on the execution of this command.
  1435. X
  1436. XSee the section titled "Screen Dump" for more information.
  1437. XThe subsection titled "Multiscreen and Non-Multiscreen" will be
  1438. Xof particular interest when using screen dumps in an
  1439. Xautomated environment.
  1440. X
  1441. X.*s 3 "send"
  1442. Xusage: send [-n] <str>
  1443. X
  1444. XThis command sends <str> to the communications line.  If the '-n'
  1445. Xswitch is omitted, a carriage return (0x0D) is transmitted after <str>.
  1446. XIf '-n' is supplied, no carriage return is transmitted.
  1447. X
  1448. X.DS L
  1449. XExamples:
  1450. X
  1451. X    send 'ps -au'
  1452. X    send -n %chr(0x02)+"START'+%chr(0x03)
  1453. X.DE
  1454. X
  1455. X.*s 3 "set"
  1456. X.DS L
  1457. Xusage: set [$]i<name>=<int-expression>[, ...]
  1458. X       set [$]s<name>=<str-expression>[, ...]
  1459. X.DE
  1460. X
  1461. XThis command sets an integer or string variable
  1462. Xto an expression.  The 'set' verb may be omitted provided the
  1463. Xotherwise optional '$' is supplied.  There are many examples of
  1464. Xhow the set statement is performed throughout this document.
  1465. XThe examples here are to further clarify the statement's syntax.
  1466. X
  1467. XIf the '=<expression>' is omitted, the value of the variable is
  1468. Xdisplayed (useful when debugging).   If procedure tracing is
  1469. Xenabled with the
  1470. X.B ptrace
  1471. Xcommand, all variables referenced by the
  1472. X.B
  1473. Xset
  1474. Xcommand, whether a value is assigned or not, are displayed.
  1475. X
  1476. X.DS L
  1477. XExamples:
  1478. X
  1479. X    set i0=0
  1480. X    set $s0='brown',s1='The quick '+$s0+' fox'
  1481. X    set $S0              with no '=', displays contents
  1482. X    set i0,$i1,s0='abc',s1
  1483. X    $s0 = 'abc'          legal
  1484. X    set s0='abc'         legal
  1485. X    s0 = 'abc'           illegal
  1486. X.DE
  1487. X.*s 3 "sk"
  1488. Xusage: sk [-a] <str>
  1489. X
  1490. XThis command invokes the Kermit file transfer protocol to send
  1491. Xone or more files.
  1492. XIf switch '-a' is supplied,
  1493. Xnewlines are converted to carriage return/linefeed pairs.
  1494. XIf '-a' is omitted, the file(s) are transmitted without modification.
  1495. X
  1496. XInteger variable $i0 receives the exit status from the transfer.  Note:
  1497. Xprocedure execution is NOT terminated by a SIGINT to the spawned file
  1498. Xtransfer process.  It is the responsibility of the procedure to process
  1499. Xthe exit status returned in $i0.
  1500. XIf $i0 is set to -1, the file transfer program did not begin.
  1501. X
  1502. X.*s 3 "ss"
  1503. Xusage: ss <str>
  1504. X
  1505. XThis command invokes the SEAlink file transfer protocol to send
  1506. Xone or more files.
  1507. XThere is no provision in the SEAlink protocol to convert
  1508. Xnewlines to carriage return/linefeed pairs.
  1509. Xso the received files are stored as received.
  1510. X
  1511. XInteger variable $i0 receives the exit status from the transfer.  Note:
  1512. Xprocedure execution is NOT terminated by a SIGINT to the spawned file
  1513. Xtransfer process.  It is the responsibility of the procedure to process
  1514. Xthe exit status returned in $i0.
  1515. XIf $i0 is set to -1, the file transfer program did not begin.
  1516. X
  1517. X.*s 3 "sx"
  1518. Xusage: sx [-ak[l]] [<label-str>] <filename-str>
  1519. X
  1520. XThis command invokes the XMODEM or XMODEM-1K file transfer protocol
  1521. Xto send a file.  If '-k' is supplied, XMODEM-1K is used, else XMODEM.
  1522. XIf switch '-a' is supplied,
  1523. Xnewlines are converted to carriage return/linefeed pairs.
  1524. XIf '-a' is omitted, the file(s) are transmitted without modification.
  1525. XIf '-l' is supplied, then <label-str> specifies a string to
  1526. Xdisplay on the bottom of the file transfer screen.  If '-l' is
  1527. Xomitted, then <label_str> must also be omitted.
  1528. X
  1529. XInteger variable $i0 receives the exit status from the transfer.  Note:
  1530. Xprocedure execution is NOT terminated by a SIGINT to the spawned file
  1531. Xtransfer process.  It is the responsibility of the procedure to process
  1532. Xthe exit status returned in $i0.
  1533. XIf $i0 is set to -1, the file transfer program did not begin.
  1534. X
  1535. X.DS L
  1536. XExamples:
  1537. X
  1538. X    sx -al 'sending log file' '/tmp/log.file'
  1539. X    sx -
  1540. X.DE
  1541. X
  1542. X.*s 3 "sy"
  1543. Xusage: sy [-a[l]] [<label-str>] <filelist-str>
  1544. X
  1545. XThis command invokes the YMODEM Batch (not 
  1546. Xto be confused with XMODEM-1K) file transfer protocol
  1547. Xto send one or more files. 
  1548. X
  1549. XIf switch '-a' is supplied,
  1550. Xnewlines are converted to carriage return/linefeed pairs.
  1551. XIf '-a' is omitted, the file(s) are transmitted without modification.
  1552. XIf '-l' is supplied, then <label-str> specifies a string to
  1553. Xdisplay on the bottom of the file transfer screen.  If '-l' is
  1554. Xomitted, then <label_str> must also be omitted.
  1555. X
  1556. XInteger variable $i0 receives the exit status from the transfer.  Note:
  1557. Xprocedure execution is NOT terminated by a SIGINT to the spawned file
  1558. Xtransfer process.  It is the responsibility of the procedure to process
  1559. Xthe exit status returned in $i0.
  1560. XIf $i0 is set to -1, the file transfer program did not begin.
  1561. X
  1562. X.*s 3 "system"
  1563. Xusage: system [-l] <cmdstr>
  1564. X
  1565. XIf switch '-l', is supplied, the attached communications line 
  1566. Xbecomes the stdin and stdout for the command.
  1567. X
  1568. XInteger variable $i0 is set to
  1569. Xthe spawned process' exit status if the process exits "normally",
  1570. Xor 0x100 if the process is killed, dumps core or interrupted.
  1571. X
  1572. XNote:  procedure execution is NOT terminated by a SIGINT to
  1573. Xthe spawned process.  It is the responsibility of the procedure
  1574. Xto process the exit status returned in $i0.
  1575. XIf $i0 is set to -1, the file transfer program did not begin.
  1576. X
  1577. X.*s 3 "sz"
  1578. Xusage: sz [-anf[l]] [<label-str>] <filelist-str>
  1579. X
  1580. XThis command invokes the ZMODEM (CRC-32 capable)
  1581. Xfile transfer protocol to send one or more files. 
  1582. X
  1583. XSwitch '-n' causes the receiver to accept files with do not
  1584. Xalready exist at the remote system or which have older
  1585. Xtimes of  last access that at the sending system.
  1586. X
  1587. XSwitch '-f'  causes the full pathname of each file to be sent;
  1588. Xotherwise, the simple filename is transmitted.
  1589. X
  1590. XIf switch '-a' is supplied,
  1591. Xnewlines are converted to carriage return/linefeed pairs.
  1592. XIf '-a' is omitted, the file(s) are transmitted without modification.
  1593. X
  1594. XIf '-l' is supplied, then <label-str> specifies a string to
  1595. Xdisplay on the bottom of the file transfer screen.  If '-l' is
  1596. Xomitted, then <label_str> must also be omitted.
  1597. X
  1598. XInteger variable $i0 receives the exit status from the transfer.  Note:
  1599. Xprocedure execution is NOT terminated by a SIGINT to the spawned file
  1600. Xtransfer process.  It is the responsibility of the procedure to process
  1601. Xthe exit status returned in $i0.
  1602. XIf $i0 is set to -1, the file transfer program did not begin.
  1603. X
  1604. X.*s 3 "vidcolor"
  1605. Xusage: vidcolor <type> <fcolor> [<bcolor>]
  1606. X
  1607. XThis command allows control over the internal color choices
  1608. XECU makes.  <type> must be one of the following:
  1609. X
  1610. X.DS I
  1611. Xnormal   - normal video color
  1612. Xreverse  - reverse video color
  1613. Xnotify   - color used for low key notifications such as
  1614. X           "[interactive mode]" and "[procedure finished]"
  1615. Xsuccess  - color used for modem CONNECT messages and other
  1616. X           "success" notifications
  1617. Xalert    - color used to alert user for warning or caution
  1618. X           purposes
  1619. Xerror    - color used to display error status or messages
  1620. X.DE
  1621. X
  1622. X<fcolor> and <bcolor> are color names as described in the description of the
  1623. X.B color
  1624. Xcommand. <fcolor> choses the foreground color and must be supplied.
  1625. X<bcolor> choses the background color and is optional; if not supplied,
  1626. Xthe background color is black.
  1627. X
  1628. XNote: The vidcolor normal and reverse options are analogs of the
  1629. X.B color
  1630. Xand
  1631. X.B
  1632. Xcolor -r
  1633. X.R
  1634. Xcommand.
  1635. X
  1636. X.DS L
  1637. XExamples:  (showing ECU default internal color list)
  1638. X
  1639. X    vidcolor normal lt_green 
  1640. X    vidcolor reverse red white
  1641. X    vidcolor notify gray
  1642. X    vidcolor success lt_green 
  1643. X    vidcolor alert yellow 
  1644. X    vidcolor error red 
  1645. X.DE
  1646. X
  1647. X.*s 3 "vidnorm"
  1648. Xusage: vidnorm
  1649. X
  1650. XThis command causes later screen output to appear in the
  1651. Xnormal, as opposed to reverse video mode.
  1652. XThe
  1653. X.B color
  1654. Xcommand forces normal video mode.
  1655. X
  1656. X.*s 3 "vidrev"
  1657. Xusage: vidrev
  1658. X
  1659. XThis command causes later screen output to appear in the
  1660. Xreverse, as opposed to normal video mode.
  1661. XThe
  1662. X.B color
  1663. Xcommand forces normal video mode.
  1664. X
  1665. X.*s 3 "whilei"
  1666. X.DS L
  1667. Xusage: whilei <int> <rel-op> <int> <statement>
  1668. X       whilei <int> <rel-op> <int>
  1669. X           <statement>
  1670. X       whilei <int> <rel-op> <int>
  1671. X       {
  1672. X           any kind or number of statements
  1673. X       }
  1674. X.DE
  1675. X
  1676. XThis command executes a loop one or more statements
  1677. Xbased on a test of two integer quantities.  See the
  1678. Xdescription of the
  1679. X.B break ,
  1680. X.B else ,
  1681. X.B whilei ,
  1682. Xand
  1683. X.B whiles
  1684. Xcommmands for examples of how the command is used.
  1685. X
  1686. X.*s 3 "whiles"
  1687. X.DS L
  1688. Xusage: whiles <str> <rel-op> <str> <statement>
  1689. X       whiles <int> <rel-op> <int>
  1690. X           <statement>
  1691. X       whiles <int> <rel-op> <int>
  1692. X       {
  1693. X           any kind or number of statements
  1694. X       }
  1695. X.DE
  1696. X
  1697. XThis command executes a loop of one or more statements
  1698. Xbased on a test of two string values.  See the
  1699. Xdescription of the
  1700. X.B break ,
  1701. X.B continue ,
  1702. Xand
  1703. X.B else
  1704. Xcommmands
  1705. Xand many other examples throughout the document,
  1706. Xfor examples of how the command is used.
  1707. X
  1708. X.*s 3 "xon"
  1709. X.DS L
  1710. Xusage: xon <arg>
  1711. Xwhere <arg> is on    input and output flow control
  1712. X               off   no flow control
  1713. X               in    input flow control
  1714. X               out   output flow control
  1715. X.DE
  1716. X
  1717. XThis command enables or disables xon/xoff flow control.
  1718. X
  1719. X.DS L
  1720. XExamples:
  1721. X
  1722. X    hangup
  1723. X    dial 'mysys'
  1724. X    ifi %conn != 0 parity none;xon on
  1725. X.DE
  1726. SHAR_EOF
  1727. $TOUCH -am 1224151590 'doc/_p_cmd.txt' &&
  1728. chmod 0644 doc/_p_cmd.txt ||
  1729. echo 'restore of doc/_p_cmd.txt failed'
  1730. Wc_c="`wc -c < 'doc/_p_cmd.txt'`"
  1731. test 44600 -eq "$Wc_c" ||
  1732.     echo 'doc/_p_cmd.txt: original size 44600, current size' "$Wc_c"
  1733. true || echo 'restore of doc/_p_ifunc.txt failed'
  1734. echo End of part 33, continue with part 34
  1735. exit 0
  1736. --------------------------------------------------------------------
  1737. Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
  1738. Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols
  1739.  
  1740. exit 0 # Just in case...
  1741. -- 
  1742. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1743. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1744. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1745. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1746.